#ifndef COMMAND_BUDDY_COMMAND_H_
#define COMMAND_BUDDY_COMMAND_H_

#include "command.h"

#ifdef _WIN32
#pragma warning( push )
#pragma warning( disable : 4200 )
#endif

#pragma pack(1)
namespace Cmd
{
enum { //CMD_BUDDY
        SCMD_BUDDY_NULL                         = 0x0000,
        SCMD_BUDDY_REQUEST_BUDDY_LIST           = 0x0001,       // 请求好友列表
        SCMD_BUDDY_RESPONSE_BUDDY_LIST          = 0x0002,       // 返回好友列表
        SCMD_BUDDY_REQUEST_ADD_BUDDY            = 0x0003,       // 请求添加好友
        SCMD_BUDDY_RESPONSE_ADD_BUDDY           = 0x0004,       // 添加好友返回
        SCMD_BUDDY_REQUEST_BUDDY_INFO           = 0x0006,       // 请求好友信息
        SCMD_BUDDY_RESPONSE_BUDDY_INFO          = 0x0007,       // 返回好友信息
        SCMD_BUDDY_SET_REMARK                   = 0x0008,       // 设置好友备注
        SCMD_BUDDY_RESPONSE_SET_REMARK          = 0x0009,       // 设置备注返回
        SCMD_BUDDY_GROUP_CREATE                 = 0x000A,       // 创建好友分组
        SCMD_BUDDY_GROUP_CREATE_RES             = 0x000B,       // 创建好友分组返回
        SCMD_BUDDY_GROUP_DEL                    = 0x000C,       // 删除好友分组
        SCMD_BUDDY_GROUP_ADD_USER               = 0x000D,       // 将好友添加到分组
        SCMD_BUDDY_REQ_DEL_BUDDY                = 0x000E,       // 请求删除好友
        SCMD_BUDDY_RES_DEL_BUDDY                = 0x000F,       // 删除好友返回
        SCMD_BUDDY_CHANGE_STATE                 = 0x0010,       // 用户改变状态
        SCMD_BUDDY_NOTIFY_CHANGE_STATE          = 0x0011,       // 用户改变状态通知好友
        SCMD_BUDDY_REQ_P2P_VOICE                = 0x0012,       // 用户请求与某用户语音聊天
        SCMD_BUDDY_RES_P2P_VOICE                = 0x0013,       // 用户应答是否与用户语音聊天
        SCMD_BUDDY_NOTIFY_P2P_VOICE_ADDR        = 0x0014,       // 返回给用户语聊服务器地址
        SCMD_BUDDY_END_P2P_VOICE                = 0x0015,       // 用户请求结束单人语音
        SCMD_BUDDY_UPDATE_NICKNAME_NOTIFY       = 0x0016,       // 用户修改昵称后通知好友
        SCMD_BUDDY_UPDATE_MOOD_NOTIFY           = 0x0017,       // 用户修改心情后通知好友
        SCMD_BUDDY_GROUP_LIST_REQ               = 0x0018,       // 好友分组列表 请求
        SCMD_BUDDY_GROUP_LIST_RES               = 0x0019,       // 好友分组列表 返回
        SCMD_BUDDY_GROUP_DEL_RES                = 0x001A,       // 好友分组删除 返回结果
        SCMD_BUDDY_GROUP_ADD_USER_RES           = 0x001B,       // 好友分组添加好友 返回结果
        SCMD_BUDDY_GROUP_RENAME                 = 0x001C,       // 好友分组重命名
        SCMD_BUDDY_GROUP_RENAME_RES             = 0x001D,       // 好友分组重命名返回
        SCMD_BUDDY_GROUP_UPDATE_ORDER           = 0x001E,       // 好友分组更新顺序
        SCMD_BUDDY_GROUP_UPDATE_ORDER_RES       = 0x001F,       // 好友分组更新顺序返回
        SCMD_BUDDY_CURRENT_ROOM_REQ             = 0x0020,       // 请求好友当前所在的房间
        SCMD_BUDDY_CURRENT_ROOM_RES             = 0x0021,       // 返回好友当前所在的房间
        SCMD_BUDDY_CURRENT_ROOM_REQ_SS          = 0x0022,       // 请求好友当前所在的房间(server使用)
        SCMD_BUDDY_MIS_STATE_REQ                = 0x0023,       // 请求MIS成员列表状态
        SCMD_BUDDY_MIS_STATE_RES                = 0x0024,       // 返回MIS成员列表状态
        SCMD_BUDDY_CHAT                         = 0x0025,       // 文字聊天
        SCMD_BUDDY_USER_STATE_REQ               = 0x0026,       // 请求好友状态
        SCMD_BUDDY_USER_STATE_RES               = 0x0027,       // 返回好友状态
        SCMD_BUDDY_SIMPLE_INFO_REQ              = 0x0028,       // 请求用户的简单信息
        SCMD_BUDDY_SIMPLE_INFO_RES              = 0x0029,       // 返回用户的简单信息
        SCMD_BUDDY_LIST_FOR_APP_REQ             = 0x002A,       // 移动端请求好友列表
        SCMD_BUDDY_LIST_FOR_APP_RES             = 0x002B,       // 移动端请求好友列表-返回
};

struct stBuddyRequestBuddyList :
                t_NullCmd {
        stBuddyRequestBuddyList():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_REQUEST_BUDDY_LIST)
        {
        }
};
struct stBuddyResponseBuddyList :
                t_NullCmd {
        stBuddyResponseBuddyList():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RESPONSE_BUDDY_LIST)
        {
                size_ = 0;
                finish = 0;
        }
        WORD  size_;
        BYTE  finish; //0-not finish; 1-finish
        struct stBuddySimpleInfo {
                DWORD buddy_id_;  // 好友用户ID
                BYTE group_id_;  // 好友分组ID, 没有分组值为0
                BYTE status_; // 用户在线状态, 参考eIMOnlineStatus
                BYTE account_[MAX_ACCOUNT_SIZE + 1]; // user account
        } buddy_list_[0];
        DWORD getSize()
        {
                return sizeof(*this) + size_ * sizeof(buddy_list_[0]);
        }
};
struct stBuddyRequestAddBuddy :
                t_NullCmd {
        stBuddyRequestAddBuddy() :
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_REQUEST_ADD_BUDDY)
        {
                requestor_ = 0;  // 发起用户ID
                buddy_id_ = 0;  // 被添加用户ID
                bzero(requestor_account_, sizeof(requestor_account_));
                bzero(requestor_nickname_, sizeof(requestor_nickname_));
                bzero(request_info_, sizeof(request_info_));
        }
        DWORD requestor_;
        DWORD buddy_id_;
        char requestor_account_[MAX_ACCOUNT_SIZE + 1];  //server fill
        char requestor_nickname_[MAX_NAME_SIZE + 1];    //server fill
        char request_info_[MAX_ADD_BUDDY_INFO_LEN + 1];
};
enum eAddBuddyRetCode {
        eAddBuddyRetCode_Null = 0x00,
        eAddBuddyRetCode_Accept,        //被请求者同意
        eAddBuddyRetCode_AcceptAndAdd,  //被请求者同意并且添加请求者为好友
        eAddBuddyRetCode_Deny,          //被请求者拒绝
        eAddBuddyRetCode_MyFull,        //请求者好友已达上限
        eAddBuddyRetCode_HisFull,       //被请求者好友已达上限
        eAddBuddyRetCode_Fail,          //请求添加失败
        eAddBuddyRetCode_Success,       //添加好友成功
        eAddBuddyRetCode_SuccessWithoutNotify,//默默地成功了
};
struct stBuddyResponseAddBuddy :
                t_NullCmd {
        stBuddyResponseAddBuddy() :
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RESPONSE_ADD_BUDDY)
        {
                requestor_ = 0;
                buddy_id_  = 0;
                ret_code_  = eAddBuddyRetCode_Fail;
                bzero(buddy_account_, sizeof(buddy_account_));
                bzero(buddy_nickname_, sizeof(buddy_nickname_));
                bzero(deny_info_, sizeof(deny_info_));
        }
        DWORD requestor_;  // 发起者用户ID
        DWORD buddy_id_;  // 被邀请者用户ID
        BYTE ret_code_;  // 返回代码, 参考eAddBuddyRetCode
        char buddy_account_[MAX_ACCOUNT_SIZE + 1];
        char buddy_nickname_[MAX_NAME_SIZE + 1];
        char deny_info_[MAX_DENY_BUDDY_INFO_LEN + 1];
};
struct stBuddySetRemark :
                t_NullCmd {
        stBuddySetRemark() :
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_SET_REMARK)
        {
                buddy_id_ = 0;
                bzero(remark_, sizeof(remark_));
        }
        DWORD buddy_id_;  // 好友用户ID
        BYTE remark_[MAX_REMARK_SIZE + 1]; // 好友备注名
};
struct stBuddyResponseSetRemark:
                t_NullCmd {
        stBuddyResponseSetRemark():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RESPONSE_SET_REMARK)
        {
                buddy_id_ = 0;
                bzero(remark_, sizeof(remark_));
                ret_code_ = 0;
        }
        DWORD buddy_id_;  // 好友用户ID
        BYTE remark_[MAX_REMARK_SIZE + 1]; // 好友备注名
        BYTE ret_code_; //0-fail, 1-success
};
struct stBuddyRequestBuddyInfo:
                t_NullCmd {
        stBuddyRequestBuddyInfo() :
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_REQUEST_BUDDY_INFO)
        {
                buddy_num_ = 0;
        }
        WORD buddy_num_;  // 好友id个数
        DWORD buddy_list_[0];  // 好友id数组头
        DWORD getSize()
        {
                return sizeof(*this) + buddy_num_ * sizeof(buddy_list_[0]);
        }
};
struct stBuddyResponseBuddyInfo :
                t_NullCmd {
        stBuddyResponseBuddyInfo():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RESPONSE_BUDDY_INFO)
        {
                buddy_id_ = 0;
                bzero(nick_name_, sizeof(nick_name_));
                bzero(remark_, sizeof(remark_));
                bzero(account_, sizeof(account_));
                bzero(mood_, sizeof(mood_));
                status_ = USER_STATE_OFFLINE;
        }
        DWORD buddy_id_;  // 好友ID
        char nick_name_[MAX_NAME_SIZE + 1]; // 昵称
        char remark_[MAX_REMARK_SIZE + 1]; // 好友备注
        char account_[MAX_ACCOUNT_SIZE + 1]; // 好友账号
        char mood_[MAX_MOOD_SIZE + 1]; // 好友心情
        BYTE status_;  // 好友在线状态, 参考eIMOnlineStatus
};
struct stBuddyGroupCreate:
                t_NullCmd {
        stBuddyGroupCreate():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_CREATE)
        {
                bzero(group_name_, sizeof(group_name_));
        }
        char group_name_[MAX_NAME_SIZE + 1]; // 用户分组名称
};
struct stBuddyGroupCreateRes:
                t_NullCmd {
        stBuddyGroupCreateRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_CREATE_RES)
        {
                bzero(group_name_, sizeof(group_name_));
                group_id_ = 0;
                order_ = 0;
                ret_code_ = 0;
        }
        char group_name_[MAX_NAME_SIZE + 1]; // 用户分组名称
        BYTE group_id_; // 用户分组ID
        BYTE order_;  // 客户端分组显示的顺序值.
        BYTE ret_code_; //0-fail, 1-success
};
struct stBuddyGroupDel:
                t_NullCmd {
        stBuddyGroupDel():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_DEL)
        {
                group_id_ = 0;
        }
        BYTE group_id_;  // 分组ID
};
struct stBuddyGroupAddUser:
                t_NullCmd {
        stBuddyGroupAddUser():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_ADD_USER)
        {
                num_ = 0;
                group_id_ = 0;
        }
        WORD num_;  // 好友ID个数
        BYTE group_id_;  // 分组ID
        DWORD buddy_list_[0];  // 好友ID数组头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(buddy_list_[0]);
        }
};
struct stBuddyReqDel:
                t_NullCmd {
        stBuddyReqDel():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_REQ_DEL_BUDDY)
        {
                user_id_ = 0;
                buddy_id_ = 0;
                del_from_his_list_ = 0;
        }
        DWORD user_id_;  // 发起用户ID
        DWORD buddy_id_;  // 好友ID
        BYTE del_from_his_list_;     //将我从对方好友列表中删除: 0-no, 1-yes
};
struct stBuddyResDel:
                t_NullCmd {
        stBuddyResDel():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RES_DEL_BUDDY)
        {
                user_id_ = 0;
                buddy_id_ = 0;
        }
        DWORD user_id_;  // 发起用户ID
        DWORD buddy_id_;  // 被删除用户ID
        BYTE ret_code_; // 返回代码. 0-fail, 1-ok
};
struct stBuddyChangeState:
                t_NullCmd {
        stBuddyChangeState():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_CHANGE_STATE)
        {
                user_id_ = 0;
                status_ = USER_STATE_ONLINE;
        }
        DWORD user_id_; // 用户ID
        BYTE status_;   // 用户状态, 参考eIMOnlineStatus
};
struct stBuddyNotifyChangeState:
                t_NullCmd {
        stBuddyNotifyChangeState():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_NOTIFY_CHANGE_STATE)
        {
                user_id_ = 0;
                status_ = USER_STATE_ONLINE;
        }
        DWORD user_id_;  // 用户ID
        BYTE status_;// 用户状态, 参考eIMOnlineStatus
};
struct stBuddyReqP2PVoice:
                t_NullCmd {
        stBuddyReqP2PVoice():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_REQ_P2P_VOICE)
        {
                requestor_ = 0;
                buddy_ = 0;
        }
        DWORD requestor_;       //请求者ID
        DWORD buddy_;           //被请求者ID
};
struct stBuddyResP2PVoice:
                t_NullCmd {
        stBuddyResP2PVoice():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_RES_P2P_VOICE)
        {
                answer_ = 0;
                requestor_ = 0;
                accept_ = 0;
        }
        DWORD answer_;          //应答者
        DWORD requestor_;       //请求者
        BYTE accept_;           //0-deny 1-accept 2-...
};
struct stBuddyNotifyP2PVoiceAddr:
                t_NullCmd {
        stBuddyNotifyP2PVoiceAddr():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_NOTIFY_P2P_VOICE_ADDR)
        {
                user_id_ = 0;
                buddy_id_ = 0;
                channel_id_ = 0;
                ip_ = 0;
                port_ = 0;
                ret_code_ = 0;
        }
        DWORD user_id_;  // 己方用户ID
        DWORD buddy_id_;  // 对方用户ID
        DWORD channel_id_;  // 语音频道ID
        DWORD ip_;  // 服务器IP
        WORD  port_;  // 服务端口
        BYTE ret_code_; //0-fail 1-success
};
struct stBuddyEndP2PVoice:
                t_NullCmd {
        stBuddyEndP2PVoice():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_END_P2P_VOICE)
        {
                requestor_id_ = 0;
                buddy_id_ = 0;
                reason_ = 0;
        }
        DWORD requestor_id_;    // 己方好友ID, request finish voice chat
        DWORD buddy_id_;  // 对方好友ID
        BYTE  reason_;          //client fill:0-finish 1-cancle 2-timeout cancle
};

struct stBuddyUpdateNickNameNotify:
                t_NullCmd {
        stBuddyUpdateNickNameNotify():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_UPDATE_NICKNAME_NOTIFY)
        {
                buddy_id_ = 0;
                bzero(nick_name_, sizeof(nick_name_));
        }
        DWORD buddy_id_;  // 用户ID
        char nick_name_[MAX_NAME_SIZE + 1]; // 昵称
};
struct stBuddyUpdateMoodNotify:
                t_NullCmd {
        stBuddyUpdateMoodNotify():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_UPDATE_MOOD_NOTIFY)
        {
                buddy_id_ = 0;
                bzero(mood_, sizeof(mood_));
        }
        DWORD buddy_id_;  // 用户ID
        char mood_[MAX_MOOD_SIZE + 1]; // 心情
};
struct stBuddyGroupListReq:
                t_NullCmd {
        stBuddyGroupListReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_LIST_REQ)
        {
        }
};
struct stBuddyGroupListRes:
                t_NullCmd {
        stBuddyGroupListRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_LIST_RES)
        {
                num_ = 0;
                finish_ = 0;
        }
        WORD num_;  // 用户分组个数
        BYTE finish_;  // 是否最后一组数据, 0--非最后一组.
        struct stGroupList {
                BYTE groupid;  // 分组ID
                BYTE order;  // 分组顺序ID
                BYTE type; // 分组类型, 参考eFriendGroupType
                char name[MAX_NAME_SIZE + 1]; // 分组名称
        } list_[0];  // 分组数组头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(list_[0]);
        }
};
struct stBuddyGroupDelRes:
                t_NullCmd {
        stBuddyGroupDelRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_DEL_RES)
        {
                group_id_ = 0;
                ret_code_ = 0;
        }
        BYTE group_id_;  // 分组ID
        BYTE ret_code_; //0-fail, 1-success
};
struct stBuddyGroupAddUserRes:
                t_NullCmd {
        stBuddyGroupAddUserRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_ADD_USER_RES)
        {
                num_ = 0;
                group_id_ = 0;
                ret_code_ = 0;
        }
        WORD num_;  // 好友ID个数
        BYTE group_id_;  // 分组ID
        BYTE ret_code_; //0-fail 1-success
        DWORD buddy_list_[0];  // 好友ID数组头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(buddy_list_[0]);
        }
};
struct stBuddyGroupRename:
                t_NullCmd {
        stBuddyGroupRename():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_RENAME)
        {
                group_id_ = 0;
        }
        BYTE group_id_;  // 分组ID
        char name_[MAX_NAME_SIZE + 1]; // 分组名
};
struct stBuddyGroupRenameRes:
                t_NullCmd {
        stBuddyGroupRenameRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_RENAME_RES)
        {
                group_id_ = 0;
                bzero(name_, sizeof(name_));
                ret_code_ = 0;
        }
        BYTE group_id_;  // 分组ID
        char name_[MAX_NAME_SIZE + 1]; // 分组名
        BYTE ret_code_; //0-fail 1-success
};
struct stBuddyGroupUpdateOrder:
                t_NullCmd {
        stBuddyGroupUpdateOrder():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_UPDATE_ORDER)
        {
                num_ = 0;
        }
        WORD num_;  // 分组个数
        struct stOrderInfo {
                BYTE group_id_;  // 分组ID
                BYTE order_;  // 分组顺序ID
        } list_[0];  // 分组信息数组头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(list_[0]);
        }
};
struct stBuddyGroupUpdateOrderRes:
                t_NullCmd {
        stBuddyGroupUpdateOrderRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_GROUP_UPDATE_ORDER_RES)
        {
                num_ = 0;
        }
        WORD num_;  // 分组信息个数
        struct stOrderInfo {
                BYTE group_id_;  // 分组ID
                BYTE order_;  // 分组顺序ID
        } list_[0];  // 分组信息数据头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(list_[0]);
        }
};
struct stBuddyCurrentRoomReq:
                t_NullCmd {
        stBuddyCurrentRoomReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_CURRENT_ROOM_REQ)
        {
                num_ = 0;
        }
        WORD num_;  // 用户ID个数
        DWORD user_list_[0];  // 用户ID数组头
        DWORD getSize()
        {
                return sizeof(*this) + num_ * sizeof(user_list_[0]);
        }
};
struct stBuddyCurrentRoomRes:
                t_NullCmd {
        stBuddyCurrentRoomRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_CURRENT_ROOM_RES)
        {
                user_id_ = 0;
                room_id_ = 0;
        }
        DWORD user_id_;  // 用户ID
        DWORD room_id_;  // 房间ID
};
struct stBuddyCurrentRoomReqSS:
                t_NullCmd {
        stBuddyCurrentRoomReqSS():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_CURRENT_ROOM_REQ_SS)
        {
                user_id_ = 0;
                requestor_ = 0;
        }
        DWORD user_id_;  // 好友ID
        DWORD requestor_;  // 发起者ID
};
struct stBuddyMisStateReq:
                t_NullCmd {
        stBuddyMisStateReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_MIS_STATE_REQ)
        {
        }
};
struct stBuddyMisStateRes:
                t_NullCmd {
        stBuddyMisStateRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_MIS_STATE_RES)
        {
                size_ = 0;
                finish_ = 0;
        }

        DWORD getSize() const
        {
                return sizeof(*this) + size_ * sizeof(list_[0]);
        }

        WORD  size_;  // 用户信息个数
        BYTE  finish_;          // 数据结束标示, 0-not finish; 1-finish
        struct stMisState {
                DWORD user_id_;  // 用户ID
                BYTE status_;  // 用户状态, 参考eIMOnlineStatus
        } list_[0];
};
struct stBuddyChat:
                t_NullCmd {
        stBuddyChat():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_CHAT)
        {
                sender_ = 0;
                receiver_ = 0;
                msg_type_ = 0;
                msg_no_ = 0;
                size_ = 0;
        }
        DWORD sender_;  // 发送者ID
        DWORD receiver_;  // 接收者ID
        BYTE  msg_type_;    // 消息类型, 参考eChatMsgType
        DWORD msg_no_;  // 接收者回执消息号
        WORD size_;  // 消息长度
        char msg_[0];  // 消息体
        DWORD getSize()
        {
                return sizeof(*this) + size_ * sizeof(msg_[0]);
        }
};
struct stBuddyUserStateReq:
                t_NullCmd {
        stBuddyUserStateReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_USER_STATE_REQ)
        {
                user_id_ = 0;
        }

        DWORD user_id_;  // 用户ID
};
struct stBuddyUserStateRes:
                t_NullCmd {
        stBuddyUserStateRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_USER_STATE_RES)
        {
                user_id_ = 0;
                status_ = USER_STATE_ONLINE;
        }
        DWORD user_id_;  // 用户ID
        BYTE status_;   // 用户状态, 参考eIMOnlineStatus
};

struct stBuddySimpleInfoReq:
                t_NullCmd {
        stBuddySimpleInfoReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_SIMPLE_INFO_REQ)
        {
                num_ = 0;
        }
        uint32_t num_;  // 用户信息个数
        uint32_t list_[0];  // 用户信息数组头
        uint32_t getSize()
        {
                return sizeof(*this) + num_ * sizeof(list_[0]);
        }
};
struct stBuddySimpleInfoRes:
                t_NullCmd {
        stBuddySimpleInfoRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_SIMPLE_INFO_RES)
        {
                len_ = 0;
                finish_ = 0;
        }
        uint32_t len_;  // 数据长度
        uint8_t  finish_;//0-not finish; 1-finish
        char data_[0]; //json格式,例如:[{id:111,nk:"ahui4367",acc:"ahui4367"},{id:111,nk:"hui4367",acc:"ahui4367"}]
        uint32_t getSize()
        {
                return sizeof(*this) + len_ * sizeof(data_[0]);
        }
};
struct stBuddyListForAppReq:
                t_NullCmd {
        stBuddyListForAppReq():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_LIST_FOR_APP_REQ)
        {
        }
};
struct stBuddyListForAppRes:
                t_NullCmd {
        stBuddyListForAppRes():
                t_NullCmd(CMD_BUDDY, SCMD_BUDDY_LIST_FOR_APP_RES)
        {
                num_ = 0;
                finish_ = 0;
        }
        uint16_t num_;  // 好友信息个数
        uint8_t  finish_; // 结束标示, 0-not finish; 1-finish
        struct {
                uint32_t buddy_id_;  // 好友ID
                uint8_t  group_id_;  // 分组信息
                char  nickname_[MAX_NAME_SIZE + 1];  // 好友昵称
        } buddy_list_[0];  // 信息数组头
        uint32_t getSize()
        {
                return sizeof(*this) + num_ * sizeof(buddy_list_[0]);
        }
};
};//namespace Cmd
#pragma pack()

#ifdef _WIN32
#pragma warning( pop )
#endif

#endif //COMMAND_BUDDY_COMMAND_H_
